{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "作业要求以学号命名，类似\"123456.ipynb\"，不需要加姓名。\n",
    "\n",
    "\n",
    "作业提交的方式见下面链接：\n",
    "https://blog.csdn.net/sheagu/article/details/122397816"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目一\n",
    "\n",
    "有一个这样的DNA核酸序列\n",
    "\n",
    "“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”\n",
    "\n",
    "请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A有20个\n",
      "G有17个\n",
      "C有12个\n",
      "T有21个\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "DNA=\"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC\"\n",
    "DNA_list=list(DNA)\n",
    "A_num=0\n",
    "G_num=0\n",
    "C_num=0\n",
    "T_num=0\n",
    "for i in range(0,len(DNA)):\n",
    " if DNA_list[i]=='A':\n",
    "  A_num+=1\n",
    " elif DNA_list[i]=='G':\n",
    "  G_num+=1\n",
    " elif DNA_list[i]=='C':\n",
    "  C_num+=1\n",
    " elif DNA_list[i]=='T':\n",
    "  T_num+=1\n",
    "print(\"A有\"+str(A_num)+\"个\\n\"+\"G有\"+str(G_num)+\"个\\n\"+\"C有\"+str(C_num)+\"个\\n\"+\"T有\"+str(T_num)+\"个\\n\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目二\n",
    "\n",
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "\n",
      "一个运动员可能得0.5分\n",
      "\n",
      "一个运动员可能得0.75分\n",
      "\n",
      "一个运动员可能得1.0分\n",
      "\n",
      "一个运动员可能得1.25分\n",
      "\n",
      "一个运动员可能得1.5分\n",
      "\n",
      "一个运动员可能得1.75分\n",
      "\n",
      "一个运动员可能得2.0分\n",
      "\n",
      "一个运动员可能得2.25分\n",
      "\n",
      "一个运动员可能得2.5分\n",
      "\n",
      "一个运动员可能得2.75分\n",
      "\n",
      "一个运动员可能得3.0分\n",
      "\n",
      "一个运动员可能得3.25分\n",
      "\n",
      "一个运动员可能得3.5分\n",
      "\n",
      "一个运动员可能得3.75分\n",
      "\n",
      "一个运动员可能得4.0分\n",
      "\n",
      "一个运动员可能得4.25分\n",
      "\n",
      "一个运动员可能得4.5分\n",
      "\n",
      "一个运动员可能得4.75分\n",
      "\n",
      "一个运动员可能得5.0分\n",
      "\n",
      "一个运动员可能得5.25分\n",
      "\n",
      "一个运动员可能得5.5分\n",
      "\n",
      "一个运动员可能得5.75分\n",
      "\n",
      "一个运动员可能得6.0分\n",
      "\n",
      "一个运动员可能得6.25分\n",
      "\n",
      "一个运动员可能得6.5分\n",
      "\n",
      "一个运动员可能得6.75分\n",
      "\n",
      "一个运动员可能得7.0分\n",
      "\n",
      "一个运动员可能得7.25分\n",
      "\n",
      "一个运动员可能得7.5分\n",
      "\n",
      "一个运动员可能得7.75分\n",
      "\n",
      "一个运动员可能得8.0分\n",
      "\n",
      "一个运动员可能得8.25分\n",
      "\n",
      "一个运动员可能得8.5分\n",
      "\n",
      "一个运动员可能得8.75分\n",
      "\n",
      "一个运动员可能得9.0分\n",
      "\n",
      "一个运动员可能得9.25分\n",
      "\n",
      "一个运动员可能得9.5分\n",
      "\n",
      "一个运动员可能得9.75分\n",
      "\n",
      "一个运动员可能得10.0分\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "scores=()\n",
    "num1=0.25\n",
    "for i in range(0,40):\n",
    " scores+=(num1+0.25*i,)\n",
    " print(\"一个运动员可能得\"+str(num1+0.25*i)+\"分\\n\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目三\n",
    "\n",
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些。\n",
    "最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肠粉是广州的一种美食，它的原料是米\n",
      "刀削面是长治的一种美食，它的原料是面\n",
      "螺蛳粉是柳州的一种美食，它的原料是粉\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "food={'肠粉':{'城市':'广州','原料':'米'},\n",
    "'刀削面':{'城市':'长治','原料':'面'},\n",
    "'螺蛳粉':{'城市':'柳州','原料':'粉'}}\n",
    "for foods,values in food.items():\n",
    " attribute=()\n",
    " for value in values.values():\n",
    "  attribute+=(value,)\n",
    " print(foods+\"是\"+attribute[0]+\"的一种美食，它的原料是\"+attribute[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
